//编写程序，使用流迭代器读取一个文本文件，存入一个vector中的string里。
#include<iostream>
#include<vector>
#include<list>
#include<algorithm>
#include<iterator>
#include<fstream>
#include<string>
using namespace std;
int main()
{
	ifstream in("text.txt");
	if (!in)
	{
		cout << "打开文件失败" << endl;
		exit(1);
	}
	istream_iterator<string>in_iter(in);
	istream_iterator<string>eof;
	vector<string>words;
	while (in_iter != eof)
		words.push_back(*in_iter++);
	for (auto word : words)
	{
		cout << word << " ";
	}
	cout << 1<<endl;
	cout << *eof;
	cout << endl;
}